import Vue from 'vue'
// 引入 i18n 插件
// 安装并引入库
import Vuei18n from 'vue-i18n'
import ElementZH from 'element-ui/lib/locale/lang/zh-CN'
import ElementEN from 'element-ui/lib/locale/lang/en'
import customZH from './zh'
import customEN from './en'
import Cookie from 'js-cookie'
// Vue.use注册
Vue.use(Vuei18n)
// 创建实例
export default new Vuei18n({
  locale: Cookie.get('language') || 'zh',
  messages: {
    zh: {
      ...ElementZH,
      ...customZH,
      morning: '早安',
      greetings: '祝你开心每一天'
    },
    en: {
      ...ElementEN,
      ...customEN,
      morning: 'Good morning',
      greetings: 'Have a good day'
    }
  }
})
